<template>
  <div>
       

<ul class="mui-table-view">
    <li class="mui-table-view-cell mui-media" v-for="items in newList" :key="items.id">
        <router-link :to="'/home/newsinfo/' + items.id">
            <img class="mui-media-object mui-pull-left" :src="items.img_url">
            <div class="mui-media-body">
               <h4> {{items.title}}</h4>
                <p class='mui-ellipsis'>
                   <span>发表时间：{{ items.add_time | dateFormat}}</span>
                    <span>点击：{{items.click}}次</span>
                </p>
            </div>
        </router-link>
    </li>
   
</ul>
  
  
  
  </div>
</template>
<script>
 
import {Toast} from 'mint-ui'
export default {
    data(){
       return{
        newList:[]
       }
   },
   created() {
      this.gettu()
   },
   methods:{
        async gettu(){
            const {data:res} = await this.$http.get('/api/getnewslist')
            console.log(res)
             if(res.status==0){
                  Toast('成功')
                  this.newList=res.message;
             }else{
                  Toast(res.message)
            }
        }  
   }
}


</script>


<style scoped>
   .mui-table-view {
 
}
 li h4{
    font-size: 10px;
  }
   
   .mui-table-view p {
      font-size: 10px;
      color: #226aff;
      display: flex;
      justify-content: space-between;
    }
     

<style>